package com.itcast.springDemo.service.impl;


import com.itcast.springDemo.factory.BeanFactory;
import com.itcast.springDemo.service.IUserService;
import com.itcast.springDemo.dao.IUserDao;

/**
 * 用户的业务层实现类
 * @author 黑马程序员
 * @Company http://www.itheima.com
 */
public class UserServiceImpl implements IUserService {

    //此种方式不好，因为有耦合
//    private IUserDao userDao = new UserDaoImpl();

    private IUserDao userDao = (IUserDao) BeanFactory.getBean("userDao");

//    private int page = 1;


    public void saveUser() {
        int page = 1;
        System.out.println(page);
        userDao.saveUser();
        page++;
    }
}
